﻿@page "/sdk/objects/application/l/{PageName?}"

@model WebVella.Erp.Plugins.SDK.Pages.Application.ListModel
@{
	Layout = "~/Pages/_AppMaster.cshtml";
	ViewData["Title"] = "Applications";
	var titleAction = "<a href=\"javascript:void(0)\" class=\"clear-filter-all\">clear all</a>";
}
<wv-page-header color="#dc3545" area-label="Applications" title="All applications list" 
	icon-class="fa fa-th" description="@Model.PageDescription">
	<wv-page-header-actions>
		<a href='/sdk/objects/application/c?returnUrl=@(Model.ReturnUrlEncoded)' class='btn btn-white btn-sm'><span class='fa fa-plus go-green'></span> Create App</a>
		<button type='button' onclick="ErpEvent.DISPATCH('WebVella.Erp.Web.Components.PcDrawer','open')" class='btn btn-white btn-sm'><span class='fa fa-search'></span> Search</button>
	</wv-page-header-actions>
</wv-page-header>

	<wv-grid bordered="true" hover="true" columns="Model.Columns" page="Model.Pager" total-count="Model.TotalCount" page-size="Model.PagerSize">
		@foreach (var record in Model.Records)
		{
			<wv-grid-row>
				<wv-grid-column>
					@Html.Raw(record["action"])
				</wv-grid-column>
				<wv-grid-column>
					@Html.Raw(record["icon"])
				</wv-grid-column>
				<wv-grid-column>
					@record["name"]
				</wv-grid-column>
				<wv-grid-column>
					@record["label"]
				</wv-grid-column>
				<wv-grid-column>
					@record["description"]
				</wv-grid-column>
			</wv-grid-row>
		}
		@if (Model.Records.Count == 0) { 
		<tbody>
			<tr>
				<td colspan="@Model.Columns.Count"><div class="alert alert-info">No pages found</div></td>
			</tr>
		</tbody>
		}
	</wv-grid>

<wv-drawer width="550px" title="Search Applications" title-action-html="@titleAction">
	<form method="get" name="SearchApplications">
		<wv-filter-text name="name" label="Name" query-type="CONTAINS"></wv-filter-text>
		<hr class="divider"/>
		<button type="submit" class="btn btn-sm btn-white">Search Applications</button>
	</form>	
</wv-drawer>

